<ui:composition template="/WEB-INF/template/template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
	
	<ui:define name="menu1">
		<ui:include src="/WEB-INF/template/menuAluno.xhtml" />
	</ui:define>
	
	<ui:define name="main1">

		<h2>Editar perfil</h2>
		<h:form>
			<h:panelGrid columns="2">
				<h:outputLabel value="Matrícula" for="login" />
				<h:inputText class="form-control" value="#{alunoBean.aluno.login}"
					id="login" disabled="true" />
				<h:outputLabel value="Nome" for="nome" />
				<h:inputText class="form-control" value="#{alunoBean.aluno.nome}"
					id="nome" required="true"
					requiredMessage="O campo nome deve ser preenchido" />
				<h:outputLabel value="E-mail" for="email" />
				<h:inputText class="form-control" value="#{alunoBean.aluno.email}"
					id="email" required="true"
					requiredMessage="O campo e-mail deve ser preenchido" />
			</h:panelGrid>
			<h:inputHidden value="#{alunoBean.aluno.login}" />
			<h:panelGrid columns="2">
				<h:commandButton class="btn btn-primary" value="Editar"
					action="#{alunoBean.alterarDados}"/>
				<a style="padding: 3px;" href="#" onclick="dlg.show()">Alterar
					Senha</a>
			</h:panelGrid>
		</h:form>

		<p:dialog header="Alterar Senha" widgetVar="dlg" modal="true"
			width="400" resizable="false">
			<h:form>
				<h:panelGrid columns="2">

					<h:outputLabel value="Senha antiga" for="senha_antiga" />
					<h:inputSecret value="#{alunoBean.aluno.senha}" id="senha_antiga" />
					<h:outputLabel value="Nova Senha" for="senha_nova" />
					<h:inputSecret value="#{alunoBean.novaSenha}" id="senha_nova" />
				</h:panelGrid>
					<h:commandButton class="btn btn-primary" value="Confimar"
						onclick="return:confirm('Confirmação')"
						action="#{alunoBean.alterarSenha}" />
			</h:form>
		</p:dialog>

	</ui:define>



	<ui:define name="information">
		<div class="panel panel-primary">
			<div class="panel-heading">
				<h4 class="panel-title">#{usuario.nome}</h4>
			</div>
			<div class="panel-body">
				<img
					src="#{facesContext.externalContext.requestContextPath}/resources/images/noavatar.jpg"
					alt="no-avatar" />
				<h5>Matrícula: #{usuario.login}</h5>
				<h5>#{usuario.email}</h5>
			</div>
		</div>
	</ui:define>
</ui:composition>